package cn.wit.test;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
/**
 * 用来做初始化操作的servlet
 * 在（web容器）tomcat启动的时候，servlet就会被创建
 * @author 16604
 *
 */
public class InitializeServlet extends HttpServlet{
	
	@Override
	public void init() throws ServletException {
		
		System.out.println("servlet初始化完成");
		
		ServletContext context = getServletContext();
		
		String logFile = context.getInitParameter("logFile");
		
		System.out.println(logFile);
		
		context.setAttribute("logFile", logFile);
	}
}
